package com.itheima;

class TestRabbit{
    int a1,a2;
    TestRabbit(){
        a1=1;a2=1;
    }
    public void printCount(int month){
        int i=1,sum=0;int t;
        for(;i<=month;i++){
            if(i==1||i==2)
                sum=1;
            else sum=a1+a2;
            System.out.println("第"+i+"个月时兔子总数为： "+sum+"对");
            if(i>2){
                t=a2;
                a2=a1+a2;
                a1=t;
            }
        }
    }
}
